#ifndef __HEAD_H___
#define __HEAD_H___

#include "aexgpio.h"

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "math.h"


#include "unistd.h"// 包含sleep();
#include "pthread.h"
#include "sched.h" //包含调度函数 

#include "signal.h"     //包含setitimer()
#include "sys/time.h"

typedef int8_t		s8;
typedef int16_t		s16;
typedef int32_t		s32;
typedef uint8_t		u8;
typedef uint16_t	u16;
typedef uint32_t	u32;

#define BIT_SET(_data_, _bit_)     do{(_data_) |= (_bit_);}while(0)
#define BIT_CLEAR(_data_, _bit_)   do{(_data_) &= ~(_bit_);}while(0)
#define BIT_READ(_data_, _bit_)    ((_data_) & (_bit_))
#define BIT_INVERT(_data_, _bit_)    do{(_data_) ^= (_bit_);}while(0)

#define _BIN(a,b,c,d,e,f,g,h) ((a<<7)+(b<<6)+(c<<5)+(d<<4)+(e<<3)+(f<<2)+(g<<1)+(h<<0))
#define _BIT(_bit_)		( 1 << _bit_ )
#define BIT_8(_bit_)		( 0x80 << _bit_ )
#define BIT_16(_bit_)		( 0x8000 << _bit_ )
#define _SIOF_BYTE(_char_)  (sizeof(_char_))
#define _SIOF_BIT(_char_)   (_SIOF_BYTE(_char_) * 8)
#define _SIOF_SELF(_char_)  (_SIOF_BYTE(_char_) / _SIOF_BYTE(_char_[0]))

#define SYS_PRINT(fmt, args...) printf(fmt, ##args) 

#endif